﻿using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Text;
using System.Threading.Tasks;


namespace Max.PH5_2103A.Shopping.TEntityFrame.Domain
{
    /// <summary>
    /// 订单信息表
    /// </summary>
    [Table("tb_order_info")]
    public class OrderMasterEntity :AuditField
    {
        public Guid Id { get; set; }

        //订单号 --- 雪花ID  (Nuget安装包：直接搜索：雪花)
        
        public string OrderNo { get; set; } = new Snowflake.Core.IdWorker(1, 1).NextId().ToString();

        //谁 ---- 会员ID（注册进来买东西的用户）
        public Guid MemberId { get; set; }

        //什么时间 --- 下单时间
        public DateTime OrderTime { get; set; }

        //花了多少  --- 订单金额
        public decimal OrderAmount { get; set; }

        //收件人信息 --- 订单的商品寄到哪里
        public string? RecivedName { get; set; }  //收件人姓名
        public string? RecivedPhone { get; set; } //收件人电话
        public string? RecivedAddress { get; set; } //收件人详细地址
        public string? Remark { get; set; }  //订单备注描述

        //订单业务状态  --- 表示订单此该查询时，它处于一个什么样的状态
        public OrderBusinessState OrderState { get; set; }

        //支付情况
        public decimal RateAmount { get; set; } = 0; //折扣金额
        public decimal? PayAmount { get; set; }  //支付金额
        public PayType? PayType { get; set; }  //支付方式
        public DateTime? PayTime { get; set;  } //付款时间
    }
}
